package cn.wenhe9.yygh.task.scheduled;

import cn.wenhe9.yygh.task.producer.TaskProducer;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author DuJinliang
 * 2022/4/8
 */
@Component
@EnableScheduling
public class ScheduledTask {

    @Resource
    private TaskProducer taskProducer;

    /**
     * 每天8点执行方法，就医提醒
     */
    @Scheduled(cron = "0/30 * * * * ?")
    public void taskPatient(){
        taskProducer.sendTask();
    }
}
